//继承
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var a = (function () {
    function a(theName) {
        this.name = theName;
    }
    a.prototype.methoda = function (arg) {
        if (arg === void 0) { arg = 1; }
        console.log(this.name + " method is " + arg * 100);
    };
    return a;
}());
var b = (function (_super) {
    __extends(b, _super);
    function b(name) {
        return _super.call(this, name) || this;
    }
    b.prototype.methodb = function (arg) {
        if (arg === void 0) { arg = 2; }
        console.log("run b.methodb()");
        _super.prototype.methoda.call(this, arg);
    };
    return b;
}(a));
var c = (function (_super) {
    __extends(c, _super);
    function c(name) {
        return _super.call(this, name) || this;
    }
    c.prototype.methoda = function (arg) {
        if (arg === void 0) { arg = 3; }
        console.log("run c.methodc()");
        _super.prototype.methoda.call(this, arg);
    };
    return c;
}(a));
var newb = new b("bbb");
var newc = new c("ccc");
newb.methodb();
newc.methoda(10);
console.log('----------------------------------------');
function intfatest(config) {
    if (config === void 0) { config = { age: 123 }; }
    var person = { name: "lala", maxage: 10 };
    if (config.name) {
        person.name = config.name;
    }
    if (config.age) {
        person.maxage = config.age;
    }
    return person;
}
var person = intfatest({ name: "riguang" });
console.log(person);
